//
//  UserInfoTableViewCell.m
//  Romens.XSBalance
//
//  Created by 王腾 on 16/2/23.
//  Copyright © 2016年 孙博. All rights reserved.
//

#import "UserInfoTableViewCell.h"
#import "ToolHelper.h"
@implementation UserInfoTableViewCell
// 方法重载
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self)
    {
        [self awakeFromNib];
    }
    return self;
}

- (void)awakeFromNib {
    // Initialization code
    [self initView];
}
-(void)initView{
    self.selectionStyle = UITableViewCellSelectionStyleDefault;
    self.userInteractionEnabled=YES;
    self.headerImg=[[UIImageView alloc]init];
    self.headerImg.translatesAutoresizingMaskIntoConstraints=NO;
    self.headerImg.contentMode=UIViewContentModeCenter;
    [self.contentView addSubview:self.headerImg];
    
    self.detailedTextField=[[UITextField alloc]init];
    self.detailedTextField.translatesAutoresizingMaskIntoConstraints=NO;
    [self.contentView addSubview:self.detailedTextField];
    
    [self.contentView addConstraints:[ToolHelper GetNSLayoutCont:NSDictionaryOfVariableBindings(_headerImg,_detailedTextField) format:@"H:|-50-[_headerImg(40)]-20-[_detailedTextField]-|"]];
    [self.contentView addConstraints:[ToolHelper GetNSLayoutCont:NSDictionaryOfVariableBindings(_headerImg) format:@"V:|[_headerImg]|"]];
    [self.contentView addConstraints:[ToolHelper GetNSLayoutCont:NSDictionaryOfVariableBindings(_detailedTextField) format:@"V:|[_detailedTextField]|"]];
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
